{include file="common/header.tpl"}
<body>
{assign var="partner" value="current"}
{include file="common/toptab.tpl"}
<div id="tabs4">
</div>
<script src="includes/js/partner.js" type="text/javascript"></script>
{if $smarty.get.sub1 == 'editpartner'}
	{include file='partner_edit.tpl'}
{elseif $smarty.get.sub1 == 'addpartner'}
	{include file="partner_add.tpl"}
{else}
<div class="wrap">
<table width="100%" height="100%" cellpadding="0" cellspacing="0">
	<tr>
	<td width="54px" height="43px" class="fr_lefttop"></td>
	<td height="43px" class="fr_centertop" ></td>
	<td width="48px" height="43px" class="fr_righttop"></td>
	</tr>
	<tr>
	<td width="54px" class="fr_leftmiddle" >&nbsp;</td>
<td class="fr_centermiddle">
{if $smarty.cookies.message == null}
	<div id="ajaxResponse1" class="ajaxResponse"></div>
{else}
	<div id="ajaxResponse1" class="ajaxResponse fade" style="display:block">{if $smarty.cookies.message != NULL}{$smarty.cookies.message}{/if}</div>
{/if}
<h2>{t}Partner{/t}</h2>
<p>
		<a href="?mod={$smarty.get.mod}&sub1=addpartner">
				<b>{t escape=no}Create New Partner &raquo;{/t}</b></a>
	</p>
	<table class="widefat">
		<thead>
		<tr>
			<th scope="col" style="text-align: center">{t}ID{/t}</th>
	        <th scope="col">{t}Name{/t}</th>
	        <th scope="col">{t}Image{/t}</th>
	        <th scope="col" style="text-align: center">{t}Status{/t}</th>
	        <th scope="col" style="text-align: center">{t}URL{/t}</th>
	        <th colspan="2" style="text-align: center">{t}Action{/t}</th>
		</tr>
		</thead>
		<tbody id="advtable">
			{foreach name=adv from=$ALLPARTNER item=item}
				<tr id="partner-{$item->partner_id}" class="{cycle values=,alternate}">
					<th scope='row' style='text-align: center'>{$item->partner_id}</th>
					<td>{$item->partner_name}</td>
					<td><img src="{$PATH}{$item->partner_image}" alt="" border="0" /></td>
					<td align='center'>{$item->partner_status}</td>
					<td align='center'>{$item->partner_url}</td>
					<td>
                   	  <a href="?mod=partnerman&sub1=editpartner&id={$item->partner_id}" class='edit'>{t}Edit{/t}</a>
                     </td>
					<td>
                    	<a onClick="onDeletePartner('?mod=partnerman', '{$item->partner_id}', '{$item->partner_image}')" 
								class='delete'>{t}Delete{/t}</a></td>
				</tr>
			{/foreach}
		</tbody>
	</table>
</td>
<td width="48px" class="fr_rightmiddle"></td>
</tr>
<tr>
<td width="54px" height="60px" class="fr_leftbot" ></td>
<td height="60px" class="fr_centerbot"></td>
<td width="48px" height="60px" class="fr_rightbot" ></td>
</tr>
</table>
</div>
{/if}
</body>